#!/bin/sh
#先进入gtk/openh264 执行 make && sudo make install 
#安装openh264库
#current_path=`pwd`
#cd gtk/openh264
#make
#sudo make install
#cd $current_path

PREFIX=/opt/qemu-client
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PREFIX/lib64/pkgconfig:$PREFIX/share/pkgconfig
export LD_LIBRARY_PATH=$PREFIX/lib:$PREFIX/lib64
export LD_INCLUDE_PATH=$PREFIX/include
export PATH=$PREFIX/bin:$PATH
chmod +x configure
chmod +x ./spice-common/spice_codegen.py
chmod +x  ./gtk/keymap-gen.pl 
chmod +x build-aux/git-version-gen
touch spice-common/common/generated_*
touch spice-common/spice-protocol/spice/enums.h

FLASH_CFLAGS="-DFLASH -I$PREFIX/include/cef"
FLASH_LIBS="-L$PREFIX/lib -lflashrouter"

./configure --prefix=$PREFIX --with-gtk=2.0 --with-x11 --enable-vala --enable-usbredir=yes --enable-smartcard=yes --enable-webdav=no --enable-lz4=yes --with-coroutine=gthread CFLAGS="$FLASH_CFLAGS" LDFLAGS=" $FLASH_LIBS"
make clean
make 
